<!DOCTYPE html>
<html lang='en'>
<head>
    <meta charset='UTF-8'>
    <meta name='viewport' content='width=device-width, initial-scale=1.0'>
    <title>Document</title>
    <script type='text/javascript' src='js/vue.js'></script>
</head>
<body>
    <div id='app'>
        {{msg}}===
        <form action="">
            <input type="text" name="" id="" v-model.number='aa'> +
            <input type="text" name="" id="" v-model.number='bb'> ++++{{sub}}++++++
        </form>
       
    </div>
    <script type='text/javascript'>
        var vm = new Vue({
            el: '#app',
            data: {
                msg: 'Hello Vue',
                aa:1,
                bb:2,
                sub:0
            },
            watch:{
                aa(){
                    console.log(11111);
                    this.sub=this.aa+this.bb
                },
                bb(newVal,oldVal){
                    console.log(newVal,oldVal,8888);
                    
                    this.sub=this.aa+this.bb
                }
            },
            // computed:{
            //     total(){
            //         return this.aa+this.bb
            //     }
            // }
        });
    </script>
</body>
</html>